package com.star.mall.controller;

import com.star.mall.persistence.entity.UserScore;
import com.star.mall.persistence.service.IUserScoreService;
import com.star.mall.utils.ContextUtil;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import com.star.mall.base.BaseController;

/**
 * <p>
 * 用户积分表 前端控制器
 * </p>
 *
 * @author StarQ
 * @since 2021-08-02
 */
@RestController
@RequestMapping("/api/v1/user/score")
public class UserScoreController extends BaseController<IUserScoreService, UserScore> {

    @GetMapping("/test")
    @ApiOperation(value = "根据ID获取实体", httpMethod = "GET", notes = "根据ID获取实体")
    public void get() {
        for (int i=0;i<10;i++) {
            int finalI = i+1;
            Thread thread = new Thread(() -> {
                service.addScore(finalI, "1");
            });
            thread.start();
        }
    }

}
